home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / libx11 / include / x11 / xauth.h < prev    next >
C/C++ Source or Header  |  1999-01-01  |  3KB  |  144 lines

  1. /*
  2.  * Xau - X Authorization Database Library
  3.  *
  4.  * $XConsortium: Xauth.h,v 1.12 91/07/15 18:12:39 gildea Exp $
  5.  *
  6.  * Copyright 1988 Massachusetts Institute of Technology
  7.  *
  8.  * Permission to use, copy, modify, and distribute this software and its
  9.  * documentation for any purpose and without fee is hereby granted, provided
  10.  * that the above copyright notice appear in all copies and that both that
  11.  * copyright notice and this permission notice appear in supporting
  12.  * documentation, and that the name of M.I.T. not be used in advertising or
  13.  * publicity pertaining to distribution of the software without specific,
  14.  * written prior permission.  M.I.T. makes no representations about the
  15.  * suitability of this software for any purpose.  It is provided "as is"
  16.  * without express or implied warranty.
  17.  *
  18.  * Author:  Keith Packard, MIT X Consortium
  19.  */
  20.  
  21. #ifndef _Xauth_h
  22. #define _Xauth_h
  23.  
  24. # include   <X11/Xfuncproto.h>
  25.  
  26. # include   <stdio.h>
  27.  
  28. # define FamilyLocal (256)    /* not part of X standard (i.e. X.h) */
  29. # define FamilyWild  (65535)
  30. # define FamilyNetname    (254)   /* not part of X standard */
  31.  
  32. typedef struct xauth {
  33.     unsigned short   family;
  34.     unsigned short   address_length;
  35.     char            *address;
  36.     unsigned short   number_length;
  37.     char            *number;
  38.     unsigned short   name_length;
  39.     char            *name;
  40.     unsigned short   data_length;
  41.     char           *data;
  42. } Xauth;
  43.  
  44. _XFUNCPROTOBEGIN
  45.  
  46. char *XauFileName();
  47.  
  48. Xauth *XauReadAuth(
  49. #if NeedFunctionPrototypes
  50. FILE*    /* auth_file */
  51. #endif
  52. );
  53.  
  54. int XauLockAuth(
  55. #if NeedFunctionPrototypes
  56. _Xconst char*    /* file_name */,
  57. int        /* retries */,
  58. int        /* timeout */,
  59. long        /* dead */
  60. #endif
  61. );
  62.  
  63. int XauUnlockAuth(
  64. #if NeedFunctionPrototypes
  65. _Xconst char*    /* file_name */
  66. #endif
  67. );
  68.  
  69. int XauWriteAuth(
  70. #if NeedFunctionPrototypes
  71. FILE*        /* auth_file */,
  72. Xauth*        /* auth */
  73. #endif
  74. );
  75.  
  76. Xauth *XauGetAuthByName(
  77. #if NeedFunctionPrototypes
  78. _Xconst char*    /* display_name */
  79. #endif
  80. );
  81.  
  82. Xauth *XauGetAuthByAddr(
  83. #if NeedFunctionPrototypes
  84. #if NeedWidePrototypes
  85. unsigned int    /* family */,
  86. unsigned int    /* address_length */,
  87. #else
  88. unsigned short    /* family */,
  89. unsigned short    /* address_length */,
  90. #endif
  91. _Xconst char*    /* address */,
  92. #if NeedWidePrototypes
  93. unsigned int    /* number_length */,
  94. #else
  95. unsigned short    /* number_length */,
  96. #endif
  97. _Xconst char*    /* number */,
  98. #if NeedWidePrototypes
  99. unsigned int    /* name_length */,
  100. #else
  101. unsigned short    /* name_length */,
  102. #endif
  103. _Xconst char*    /* name */
  104. #endif
  105. );
  106.  
  107. Xauth *XauGetBestAuthByAddr(
  108. #if NeedFunctionPrototypes
  109. #if NeedWidePrototypes
  110. unsigned int    /* family */,
  111. unsigned int    /* address_length */,
  112. #else
  113. unsigned short    /* family */,
  114. unsigned short    /* address_length */,
  115. #endif
  116. _Xconst char*    /* address */,
  117. #if NeedWidePrototypes
  118. unsigned int    /* number_length */,
  119. #else
  120. unsigned short    /* number_length */,
  121. #endif
  122. _Xconst char*    /* number */,
  123. int        /* types_length */,
  124. char**        /* type_names */,
  125. _Xconst int*    /* type_lengths */
  126. #endif
  127. );
  128.  
  129. void XauDisposeAuth(
  130. #if NeedFunctionPrototypes
  131. Xauth*        /* auth */
  132. #endif
  133. );
  134.  
  135. _XFUNCPROTOEND
  136.  
  137. /* Return values from XauLockAuth */
  138.  
  139. # define LOCK_SUCCESS    0    /* lock succeeded */
  140. # define LOCK_ERROR    1    /* lock unexpectely failed, check errno */
  141. # define LOCK_TIMEOUT    2    /* lock failed, timeouts expired */
  142.  
  143. #endif /* _Xauth_h */
  144.